﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace YJKRevitBeam.SplitBream
{
	internal class SelectBream
	{
		public SelectBream(ExternalCommandData commandData)
		{
			this.m_commandData = commandData;
			this.m_uiDoc = commandData.Application.ActiveUIDocument;
			this.m_doc = this.m_uiDoc.Document;
		}

		public FamilyInstance GetSelectBream()
		{
			StructBreamFilter structBreamFilter = new StructBreamFilter();
			Reference reference = this.m_uiDoc.Selection.PickObject((Autodesk.Revit.UI.Selection.ObjectType)1, structBreamFilter, "请选择一根结构梁");
			return this.m_doc.GetElement(reference) as FamilyInstance;
		}

		private ExternalCommandData m_commandData;

		private UIDocument m_uiDoc;

		private Document m_doc;
	}
}
